package ClassWork.Work_03.Cart;

import java.util.List;

public class ProduceService {
    public static void produceService(List<Produce> pro){
        Produce produce = new Produce("01","百岁山",3);
        pro.add(produce);
        produce = new Produce("02","娃哈哈",2.5);
        pro.add(produce);
        produce = new Produce("03","农夫山泉",2);
        pro.add(produce);
        produce = new Produce("04","康师傅",2);
        pro.add(produce);
    }

    public static void putProduce(List<Produce> pro){
        for(int i = 0; i < pro.size(); i++){
            Produce produce = pro.get(i);
            System.out.println(i + 1 + "\t" + produce.getPName() + "\t" + produce.getPrice());
        }
    }
}
